package net.xiduth.game.player.dialogues.auto;

import net.xiduth.game.player.dialogues.Dialogue;

/**
 * 
 * @author Oracle
 * 
 * Yummy vote box.
 * 
 */
public class VoteBox extends Dialogue {

	@Override
	public void start() {
		sendOptionsDialogue("Pick a reward.", "20M GP.",
				"2500 Loyalty points.", "3x Magic Whistles + Stardust",
				"Dragon bones.", "Rocktails.");
		stage = 4;
	}

	@Override
	public void run(int interfaceId, int option) {
		switch (stage) {
		case 3:
			player.getInventory().deleteItem(6199, 1);
			end();
			player.unlock();
			break;
		case 4:
			switch (option) {
			case OPTION_1:
				player.getInterfaceManager().closeChatBoxInterface();
				player.sm("Thanks for voting, your reward has been added to your bank.");
				player.getBank().addItem(995, 20000000, true);
				player.getInventory().deleteItem(6199, 1);
				end();
				player.unlock();
				player.getInterfaceManager().closeChatBoxInterface();
				break;
			case OPTION_2:
				player.getInterfaceManager().closeChatBoxInterface();
				player.sm("Thanks for voting.");
				player.setLoyaltyPoints(player.getLoyaltyPoints() + 2500);
				player.getInventory().deleteItem(6199, 1);
				end();
				player.unlock();
				player.getInterfaceManager().closeChatBoxInterface();
				break;
			case OPTION_3:
				player.getInterfaceManager().closeChatBoxInterface();
				player.sm("Thanks for voting, your reward has been added to your bank.");
				player.getBank().addItem(16, 3, true);
				player.getBank().addItem(13727, 100, true);
				player.getInventory().deleteItem(6199, 1);
				end();
				player.unlock();
				player.getInterfaceManager().closeChatBoxInterface();
				break;
			case OPTION_4:
				player.getInterfaceManager().closeChatBoxInterface();
				player.sm("Thanks for voting, your reward has been added to your bank.");
				player.getBank().addItem(536, 100, true);
				player.getInventory().deleteItem(6199, 1);
				end();
				player.unlock();
				player.getInterfaceManager().closeChatBoxInterface();
				break;
			case OPTION_5:
				player.getInterfaceManager().closeChatBoxInterface();
				player.sm("Thanks for voting, your reward has been added to your bank.");
				player.getBank().addItem(15272, 100, true);
				player.getInventory().deleteItem(6199, 1);
				end();
				player.unlock();
				player.getInterfaceManager().closeChatBoxInterface();
				break;
			default:
				end();
				break;
			}
		}
	}

	@Override
	public void finish() {

	}

}
